<template>
    <div class="psearch">
        <div>
            <van-tabs v-model:active="active">
                <van-tab title="按成员筛选" name="1"></van-tab>
                <van-tab title="按标签筛选" name="2"></van-tab>
            </van-tabs>
        </div>
        <div class="mainbox">
            <div v-show="active==1"><member v-model="userIds"/></div>
            <div v-show="active==2"><tag v-model="tagIds"/></div>
        </div>
        <div class="btnBox">
            <div class="btn" @click="goSearch">确定</div>
            <div class="btn cancel" @click="cancel">取消</div>
        </div>
    </div>
</template>

<script setup>
import {ref} from "vue"
import member from './member.vue'
import tag from './tag.vue'
const emit = defineEmits(['close','search'])

const active = ref('')
const userIds = ref([])
const tagIds = ref([])

const goSearch = ()=>{
    emit('search',{userIds:userIds.value,tagIds:tagIds.value})
    cancel()
}

const cancel = ()=>{
    emit('close')
}
</script>

<style lang="scss">
.psearch{
    display: flex;
    width: 100%;
    height: 100%;
    flex-flow: column;
    .mainbox{
        flex: 1;
        overflow: hidden;
        overflow-y: auto;
    }
    .btnBox{
        display: flex;
        height: 100px;
        background-color: #eee;
        .btn{
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 1;
            font-size: 28px;
            background-color: #e3af2f;
            color: #fff;
            width: 100%;
            height: 100%;
            &.cancel{
                background: none;
                color: #333;
            }
        }
    }
}
</style>